danballfandomcom-20200222-history
Logic gate
A logic gate in Powder Game and Powder Game 2 is a simple machine that takes input(s) (on/off) and performs a logical operation to provide an output (on/off). Logic gates can be made with a metal and thunder circuit, with laser and mirrors, or C-4. However, the former allows more complexity. Combinations of these three technologies are also possible. Mathematical analysis For x'' inputs, there are 2^{2x} possible logic gates (assuming there is at least one input; there are 2 possible logic gates for zero inputs: the 1 gate and 0 gate, even though 2^{2*0} =1, as anything to the zeroth power is one). One input There are four possible one-input logic gates. The last one is the normal gate that does not do anything. (1→1, 0→0) 0 gate The 0 gate always produces an off output, regardless of the input. (0→0, 1→0) NOT gate For the output to be on, the input must be off. (0→1, 1→0) 1 gate The 1 gate always produces an on output, regardless of the input. (0→1, 1→1) ? gate The ? gate always produces the input as the output. (0→0, 1→1) Two inputs There are sixteen possible two-input logic gates: 0, AND, A > B, A, A < B, B, XOR, OR, NOR, XNOR, NOT B, A ≥ B, NOT A, A ≤ B, NAND, and 1. 0 gate The 0 gate always produces an off output, regardless of the inputs. (00→0, 01→0, 10→0, 11→0) AND gate For the output to be on, both inputs must be on. (00→0, 01→0, 10→0, 11→1) A > B gate For the output to be on, A must be greater than B. (00→0, 01→0, 10→1, 11→0) A gate For the output to be on, A must be on. (00→0, 01→0, 10→1, 11→1) XOR gate For the output to be on, one, but ''only one, of the inputs must be on. (00→0, 01→1, 10→1, 11→0) A more chance of working (but more complicated) XOR gate is to split the inputs and lead one of each input to a OR gate and a AND gate. The OR output is divided again, with one output simply destroyed and the other led to the A input of an A > B gate. The AND gate output is not divided, but sent the B input. The output of the A > B gate is the XOR output. OR gate For the output to be on, one or both of the inputs must be on. (00→0, 01→1, 10→1, 11→1) For both C-4 and metal/thunder, this type of gate is trivial. NOR gate The output is off unless both inputs are off. (00→1, 01→0, 10→0, 11→0) The below example usually works, but there is a slight chance of failure. This function of this gate is achieved by putting two inputs through an OR gate and putting the output through a NOT gate. NAND Gate The output is on unless both inputs are on. (00→1, 01→1, 10→1, 11→0) However, the input that becomes the output has to be stronger than any one of the inputs, but weaker than both combined (2 Inputs > Output > 1 Input), acting like a circuit breaker. 1 gate The 1 gate always produces an on output, regardless of the inputs. (00→1, 01→1 10→1, 11→1) Logic organizers Logic organizers are mainly for sorting pathways for lasers or electricity. However, there aren't any available codes to demonstrate this. These gates are very similar to logic gates, except they use wood, thunder, metal and rarely torch. Many Powder Game authors have been known to make these, but few have been used in uploads. Half adders Conventional half adders connect Or, And, and Not gates together to do binary arithmetic. In powder game however, this can be hard to do. To make half adders smaller and more efficient, a type of system has been invented to achieve the same mathematical outcomes. They are so small and simple that they are considered a logic gate on their own. An example may be seen here: The arithmetic is very simple for using one of these: 0+0=0 and carry 0 1+0=1 and carry 0 0+1=1 and carry 0 1+1=0 and carry 1 Laser logic Logic gates can be constructed from lasers. Lasers are usually dealt with using "tubes," which is a common name for the device usually used to construct logic gates out of lasers. A tube consists of two lines of metal (usually vertical) which are parallel and form a "tube". The two metal lines are usually two pixels apart. It is possible to pass a laser diagonally into one end of a tube so that it bounces between the two metal pieces until exiting the other end. This may be referred to as the "Z" laser. There may be one or more "Z" lasers. A second laser is then passed parallel to the two metal lines and touching the side of one of the lines. It does this in such a way that is intersects every other point at which the "Z" laser reflects and each time, has a high probability of blocking the "Z" laser. This blocking or "B" laser then exits the other end of the tube. There may be one or more "B" lasers. Therefore, a "B" laser, if present, will block any "Z" lasers present. This function highly resembles that of a normally closed relay. While the "B" laser can usually block the "Z" laser in one or two intersection regardless of direction there are some handy standards to keep in mind. A well constructed tube will usually have the "Z" and "B" lasers heading in from opposite ends of a tube. Also, both pieces of metal in a tube are usually nine pixels long. This will ensure (given a laser of adequate density) that the "Z" laser(s) are always blocked when a "B" laser is going through. Tubes usually have pieces of metal two pixels long, parallel to them, and adjacent to each corner. These pieces of metal (called flanges) are merely convenient in most cases as they bend a laser diagonally. A laser, intended to be a "Z" laser can be shot in a non diagonal manner at the end of one of the tube walls, the flange of metal will bend it diagonally and send it properly out of the tube, and if it emerges a second flange will bend it back onto it's previous trajectory. Mercury switch logic Only possible in Powder Game 2, logic gates can utilize mercury switches to produce an output. The following example includes all gates mentioned above. Instructions for use are included. External links *Wikipedia article on logic gates Category:Powder Game technology